package cn.itcast.springboot;

import java.nio.charset.Charset;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.StringHttpMessageConverter;

//Springboot的核心注解 主要开启自动配置，一个项目中，该注解出现一次
//exclude排除默认配置，使用自己的配置
@SpringBootApplication(exclude={RedisAutoConfiguration.class})
@SpringBootConfiguration
//@ImportResource("classpath:mybatis/mybatis-config.xml")//引入xml配置文件
public class HelloApplication {
    
 
    /**
     * web MVC工程运行需要的配置
     *  web.xml : 入口规则 
     *  包扫描
     * 
     * @param args
     */
    public static void main(String[] args) {
        SpringApplication.run(HelloApplication.class, args);
    }

    
    @Bean
    public StringHttpMessageConverter stringHttpMessageConverter(){
    	System.out.println("自定义的消息转换器开始实例化");
        StringHttpMessageConverter converter  
        	= new StringHttpMessageConverter(Charset.forName("UTF-8"));
        return converter;
}
    
    
    
    
    
    
}